package SpLib.Net
{
	import flash.events.Event;
	
	public class NetEvent extends flash.events.Event
	{
		/** 网络连接失败	*/
		public static const NET_CONNECTFAIL:String = "SpLibSocketConnectFail";
		
		/** 网络连接成功	*/
		public static const NET_CONNECTED:String = "SpLibSocketConnected";
		
		/** 网络连接断开	*/
		public static const NET_BREAK:String = "SpLibSocketConnectBreak";
		
		/** 收到网络消息	*/
		public static const NET_RECV:String = "SpLibSocketRecv";
			
		public var m_sName:String;
		public var m_NetPak:SpLib.Net.NetPak;
		
		public function NetEvent(name:String,pak:SpLib.Net.NetPak = null)
		{
			super(name);
			m_sName = name;
			m_NetPak = pak;
		}
		
		public override function clone():flash.events.Event
		{
			return new SpLib.Net.NetEvent(this.m_sName,this.m_NetPak);
		}
		
		public override function toString():String
		{
			return formatToString("SpLib.Net.NetEvent", "type", "bubbles", "cancelable", "eventPhase","m_sName", "m_NetPak");
		}

	}
}